//Land构造函数
(function () {
   var Land = window.Land = function () {
    this.img = game.imgS.land;
    this.x = 0;
    this.speed = 2;
  };
  //land的渲染
  Land.prototype.render = function () {
    var imgY = myCanvas.height * 0.78;  //保存比列 Y的起始位置是响应式根据设备视口变化
    game.ctx.drawImage(this.img, this.x, imgY);
    //同样的猫腻图两张
    game.ctx.drawImage(this.img, this.x + this.img.width, imgY);
    game.ctx.drawImage(this.img, this.x + this.img.width + this.img.width, imgY);
    //补全空白的大地
    game.ctx.fillStyle = "#ded895";
    game.ctx.fillRect(0, imgY + this.img.height -20 , myCanvas.width, myCanvas.height * 0.25 - 112);
  };
  //land的更新
  Land.prototype.update = function () {
    this.x -= this.speed;
    if (this.x < -336) {
      this.x = 0;
    }
    //帧事件 》 3000，速度加快 难度增加
    if (game.fno > 150) {
      this.speed = 2.5;
    }
    if (game.fno > 500) {
      this.speed = 3;
    }
    if (game.fno > 1000) {
      this.speed = 3.5;
    }
    if (game.fno > 1500) {
      this.speed = 4;
    }



  };


})();